#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<cstdlib>//rand()
#define rep(i,a,b) for(register int i = (a);i <= (b);++i)
#define per(i,a,b) for(register int i = (a);i >= (b);--i)
typedef long long ll;
typedef unsigned long long ull;
using std::string;using std::cin;using std::cout;

int n;
double dp[40000][20],inf = 1e9+9;

struct node{
    double x,y;
}a[20];

inline double min(double x,double y){if(x < y) return x; else return y;}
inline double dis(double x1,double y1,double x2,double y2){return std::sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));}

int main(){
    std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //freopen("in.in", "r", stdin);
    cin >> n;
    rep(i,1,n) cin >> a[i].x >> a[i].y;
    rep(i,0,(1 << n)) rep(j,0,n+1) dp[i][j] = inf;
    rep(i,1,n) dp[ 1 << (i - 1) ][i] = dis(0,0,a[i].x,a[i].y);
    
    rep(now,1,(1 << n) - 1){
        rep(i,1,n){
            if(now & (1<<(i-1)) == 0) continue;
            rep(j,1,n){
                //  cout <<now<<" " << j << " "<< dp[now][j] << "\n";
                if(now & (1<<(j-1)) == 1) continue;
                dp[now | (1<<(j-1))][j] = std::min(dp[now][i]+dis(a[i].x,a[i].y,a[j].x,a[j].y) , dp[now | (1<<(j-1))][j]);
            }
        }
    }
    
    double ans = inf;
    rep(i,1,n) ans = min(ans,dp[(1 << n) - 1][i]);
    printf("%.2lf\n",ans);
    return 0;
}